<html>
<head>
 
</head>
<body style="text-align=center;font-size:24px">
<div id="problemNum" style='background-color:#999999;width:400;text-align:left;'></div>
<div id="problemContent" style='background-color:#bbbbbb;width:400;text-align:left;'></div>
<div id="result" style='color:#ffff22;font-size:48;background-color:#8855ff;width:400;'></div>
 
<script language="javascript">
    //---------------------------------//
    // Project Euler 
    //  Problem 2
    //
    // Author:thrombin
    //   Date:2015-12-06
    //---------------------------------//  
var N=2;
var problem="Each new term in the Fibonacci sequence is generated by adding the previous two terms. "
            +"By starting with 1 and 2, the first 10 terms will be:"
            +"1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ..."
            +"By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.";
var A=1,B=1,C=0,sum=0;
while(sum<4e6){
    C=A+B;
    if(C%2==0)sum+=C;
    A=B;B=C;
}
document.getElementById("problemNum").innerHTML="Project Euler-Problem "+N;
document.getElementById("problemContent").innerHTML=problem;
document.getElementById("result").innerHTML="Answer:"+sum;
 
</script>
</body>
</html>